<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head th:fragment="head(title)">
    <meta charset="UTF-8">
    <!--    移动端预览设置-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title th:replace="${title}">后台公共页面</title>
    <!--    引入semantic-ui的CSS库-->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
    <!--    引入editormd的CSS库-->
    <link rel="stylesheet" th:href="@{/lib/editormd/css/editormd.css}">
    <!--    引入自定义的CSS-->
    <link rel="stylesheet" th:href="@{/css/me.css}">
</head>
<body>

<!--    导航-->
<nav th:fragment="menu(n,src)" class="ui inverted attached segment m-padded-tb-mini m-shadow-small">
    <div class="ui container">
        <div class="ui inverted secondary stackable menu">

            <a th:href="@{/admin/index}"><h2 class="ui teal header item">管理后台</h2></a>
            <a href="#" th:href="@{/admin/blogs}" class="m-item item m-mobile-hide" th:classappend="${n==1} ? 'active'"><i class="home icon"></i>博客</a>
            <a href="#" th:href="@{/admin/types}" class="m-item item m-mobile-hide" th:classappend="${n==2} ? 'active'"><i class="idea icon"></i>分类</a>
            <a href="#" th:href="@{/admin/tags}"  class="m-item item m-mobile-hide" th:classappend="${n==3} ? 'active'"><i class="tags icon"></i>标签</a>

            <div class="right menu">
                <div class="ui dropdown item">
                    <div class="text">
                        <img class="ui avatar image" th:src="${src}" src="https://picsum.photos/id/233/100/100">
                        <span th:text="${session.user.nickname}">nickname</span>
                    </div>
                    <i class="dropdown icon"></i>
                    <div class="menu">
                        <a href="#" th:href="@{/admin/logout}" class="item">注销</a>
                    </div>
                </div>
            </div>

        </div>
    </div>
    <a href="#" class="ui menu toggle black icon button m-right-top m-mobile-show">
        <i class="sidebar icon"></i>
    </a>
</nav>

<!--外部js库-->
<div th:fragment="script">
    <!--    引入jquery-->
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
    <!--    引入semantic-ui的js库-->
    <script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>
    <!--    引入editormd的js库-->
    <script th:src="@{/lib/editormd/editormd.js}"></script>
</div>


</body>
</html>